using System.Collections.Generic;
using System;
using Google.Protobuf;

public partial class ClientSessionEventBridge : INetEventBridge
{
    Dictionary<int, System.Action<IMessage>> msgHandlers = new Dictionary<int, System.Action<IMessage>>();

    public long Id { get; set; }

    void RegistNetEventHandler(int msgId, Action<IMessage> msgHandler)
    {
        msgHandlers[msgId] = msgHandler;
    }

    public void HandleMessage(int msgId, IMessage msg)
    {
        if (msgHandlers.TryGetValue(msgId, out var msgHandler))
        {
            msgHandler(msg);
        }
    }
}

public partial class ClientSessionEventBridge : INetEventBridge
{
    //BeginInitialze
	public void Initialze()
	{
		RegisteMapNetEventHandlers();
	}
	//EndInitialze
}